<?php
namespace app\index\validate;

use think\Validate;

class Member extends Validate {
    protected $rule = [
    	'real_name'    => 'require',
        'idcard'       => 'require|unique:member',
        'bank_name'    => 'require',
        'bank_no'      => 'require|unique:member',
        'alipay'      => 'require|unique:member'
    ];

    protected $message = [
        'real_name.require'    => '请输入姓名',
        'idcard.require'       => '请输入身份证号',
        'bank_name.require'    => '请输入银行名称',
        'idcard.unique'        => '该身份证已注册',
        'bank_no.unique'       => '该银行卡已注册',
        'alipay.unique'        => '该支付宝已注册'
    ];
	
	protected $scene = [
		'edit' => [
			'idcard'  => 'require|unique:member,idcard^id',
			'bank_no' => 'require|unique:member,bank_no^id',
			'alipay'  => 'require|unique:member,alipay^id'
		],
	];
}
